<?php
/**
 * @content: 视图
 * @author: xuch
 */
class view {
	public function __construct () {
		//ob_start();
	}
	
	/**
	 * @param (array/string)$viewPath
	 */
	public static function display ($viewPath, $reponse) {
		$file = 'index';
		//echo $file;
		if (isset($viewPath) || !empty($viewPath)) {
			if (is_array($viewPath)) {
				$file = implode(DIRECTORY_SEPARATOR, $viewPath);
			}
			if (is_string($viewPath)) {
				$file = $viewPath;
			}
		}
		
		$file = ROOT . DIRECTORY_SEPARATOR . APP . DIRECTORY_SEPARATOR . 'Imu' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . $file;
		$file = $file . '.php';
		//echo $file;
		$viewFile = '';
		if (is_readable($file)) {
			ob_start();
			include($file);
			$viewFile = ob_get_clean();
		}
		else {
			echo '读取视图出错';
		}
		return $viewFile;
	}
	
	
}